package org.ezplatform.office.questionnaire.entity;
 
import org.ezplatform.core.annotation.MetaData;
import org.ezplatform.core.entity.BaseCorpEntity;

import javax.persistence.*;
import java.util.Date;

/** 
* @author 作者: wujs
* @version 创建时间：2017年11月22日 上午10:23:09 
* 类说明 :问卷管理
*/
@MetaData(value = "问卷管理")
@Entity(name = "Questionnaire")
@Table(name = "oa_questionnaire", uniqueConstraints = { @UniqueConstraint(columnNames = "id") })
public class Questionnaire extends BaseCorpEntity {

	private static final long serialVersionUID = 8759194582486138788L;
	
	@MetaData(value = "名称")
  	@Column(name = "name", nullable = false, length = 255)
    private String name;
	
	@MetaData(value = "类型")
  	@Column(name = "type", nullable = false, length = 100)
    private String type;

	@Transient
	private String typeAble;
	
	@MetaData(value = "开始时间")
  	@Column(name = "start_date")
    private Date startDate;
	
	@MetaData(value = "结束时间")
  	@Column(name = "end_date")
    private Date endDate;
	
	/*
	 * 考试设置
	 */
	@MetaData(value = "重复答题：1不限制0限制")
  	@Column(name = "no_limit",length = 1)
    private String  noLimit;
	
	@MetaData(value = "重复答题次数")
  	@Column(name = "answer_num",length = 5)
    private String  answerNum;
	
	@MetaData(value = "及格分数")
  	@Column(name = "pass_score",length = 6)
    private String  passScore;
	
	/**
	 * 作废字段
	 */
	@MetaData(value = "状态 0是关闭禁用、1是开启、2是未开启")
  	@Column(name = "status", length = 10)
    private String status;
	
	@MetaData(value = "消息推送方式")
  	@Column(name = "remind_target", length = 20)
	private String remindTarget;
	/**
	 * 状态枚举
	 */
	public enum StatusEnum{
		CLOSE("0","关闭禁用"),
		OPEN("1","开启"),
		NOOPEN("2","未开启");
		private String code;
		private String value;
		StatusEnum(String code,String value){
			this.code = code;
			this.value = value;
		}
		public String getCode() {
			return code;
		}
		public void setCode(String code) {
			this.code = code;
		}
		public String getValue() {
			return value;
		}
		public void setValue(String value) {
			this.value = value;
		}
	}
	
	@MetaData(value = "适用范围")
  	@Column(name = "questionnaire_scope", nullable = false, length = 32)
    private String questionnaireScope;
	
	@MetaData(value = "答卷查看范围")
  	@Column(name = "answer_scope", nullable = false, length = 32)
    private String answerScope;
	
	@MetaData(value = "描述")
  	@Column(name = "description", length = 255)
    private String description;
	
	@MetaData(value = "问卷标题")
  	@Column(name = "title", length = 255)
    private String title;
	
	@MetaData(value = "问卷标题描述")
  	@Column(name = "title_description", length = 255)
    private String titleDescription;
	
	@MetaData(value = "问卷标题描述")
  	@Column(name = "title_description_txt", length = 255)
    private String titleDescriptionTxt;
	
	@MetaData(value = "问卷标题设置")
  	@Column(name = "title_setting", length = 500)
    private String titleSetting;

	/**
	* 推送状态位  0未推送   1 已推送
	*/
	@MetaData(value = "推送状态")
	@Column(name = "send_status")
	private int sendStatus;

	/**
	 * 推送状态枚举
	 */
	public enum SendStatusEnum{
		SEND(1,"已推送"),
		NOSEND(0,"未推送");
		private int code;
		private String value;
		SendStatusEnum(int code,String value){
			this.code = code;
			this.value = value;
		}
		public int getCode() {
			return code;
		}
		public void setCode(int code) {
			this.code = code;
		}
		public String getValue() {
			return value;
		}
		public void setValue(String value) {
			this.value = value;
		}
	}
	/**
	 *  发布状态位 0未发布  1发布 2已到期
	 */
	@MetaData(value="发布状态")
	@Column(name="publish")
	private int publish;

	@MetaData(value="题目json串")
	@Column(name="topic_json")
	private String topicJson;

	@MetaData(value="是否是手机设计的")
	@Column(name="is_mobile")
	private String isMobile;

	/**
	 * 发布状态枚举
	 */
	public enum PublishEnum{
		/**
		 * 1 已发布
		 */
	    PUBLISH(1,"已发布"),
		/**
		 * 0 未发布
		 */
		NOPUBLISH(0,"未发布"),
		/**
		 * 2已到期
		 */
		DIES_VENIT(2,"已到期"),
		;
	    private int code;
	    private String value;
	    PublishEnum(int code,String value){
	    	this.code = code;
	    	this.value = value;
		}
		public int getCode() {
			return code;
		}
		public String getValue() {
			return value;
		}
	}
	
	@MetaData(value = "截止时间")
  	@Column(name = "close_date")
    private Date closeDate;
	
	@MetaData(value="答题总人数")
	@Column(name="all_user_num")
	private int allUserNum ;
	
	@MetaData(value="问卷总分")
	@Column(name="sum_score")
	private String sumScore ;
	
	@MetaData(value="问卷题目总数")
	@Column(name="sum_topic_num")
	private String sumTopicNum ;
	
	@MetaData(value="是否定时发布（1-是，0-否）")
	@Column(name="is_timing_publish")
	private int isTimingPublish;
	
	@MetaData(value = "发布时间")
  	@Column(name = "publish_date")
    private Date publishDate;
	
	public int getAllUserNum() {
		return allUserNum;
	}

	public void setAllUserNum(int allUserNum) {
		this.allUserNum = allUserNum;
	}

	public Date getCloseDate() {
		return closeDate;
	}

	public void setCloseDate(Date closeDate) {
		this.closeDate = closeDate;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getType() {
		return type;
	}

	public void setType(String type) {
		this.type = type;
	}

	public Date getStartDate() {
		return startDate;
	}

	public void setStartDate(Date startDate) {
		this.startDate = startDate;
	}

	public Date getEndDate() {
		return endDate;
	}

	public void setEndDate(Date endDate) {
		this.endDate = endDate;
	}

	public String getStatus() {
		return status;
	}

	public void setStatus(String status) {
		this.status = status;
	}

	public String getQuestionnaireScope() {
		return questionnaireScope;
	}

	public void setQuestionnaireScope(String questionnaireScope) {
		this.questionnaireScope = questionnaireScope;
	}

	public String getAnswerScope() {
		return answerScope;
	}

	public void setAnswerScope(String answerScope) {
		this.answerScope = answerScope;
	}

	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	public String getTitleDescription() {
		return titleDescription;
	}

	public void setTitleDescription(String titleDescription) {
		this.titleDescription = titleDescription;
	}
	
	public String getTitleDescriptionTxt() {
		return titleDescriptionTxt;
	}

	public void setTitleDescriptionTxt(String titleDescriptionTxt) {
		this.titleDescriptionTxt = titleDescriptionTxt;
	}

	public String getTitleSetting() {
		return titleSetting;
	}

	public void setTitleSetting(String titleSetting) {
		this.titleSetting = titleSetting;
	}

	public int getSendStatus() {
		return sendStatus;
	}

	public void setSendStatus(int sendStatus) {
		this.sendStatus = sendStatus;
	}

	public int getPublish() {
		return publish;
	}

	public void setPublish(int publish) {
		this.publish = publish;
	}

	public String getTopicJson() {
		return topicJson;
	}

	public void setTopicJson(String topicJson) {
		this.topicJson = topicJson;
	}

	public String getIsMobile() {
		return isMobile;
	}

	public void setIsMobile(String isMobile) {
		this.isMobile = isMobile;
	}

	public String getTypeAble() {
		return typeAble;
	}

	public void setTypeAble(String typeAble) {
		this.typeAble = typeAble;
	}

	public String getSumScore() {
		return sumScore;
	}

	public void setSumScore(String sumScore) {
		this.sumScore = sumScore;
	}

	public String getSumTopicNum() {
		return sumTopicNum;
	}

	public void setSumTopicNum(String sumTopicNum) {
		this.sumTopicNum = sumTopicNum;
	}

	/**
	 * @return the isTimingPublish
	 */
	public int getIsTimingPublish() {
		return isTimingPublish;
	}

	/**
	 * @param isTimingPublish the isTimingPublish to set
	 */
	public void setIsTimingPublish(int isTimingPublish) {
		this.isTimingPublish = isTimingPublish;
	}

	/**
	 * @return the publishDate
	 */
	public Date getPublishDate() {
		return publishDate;
	}

	/**
	 * @param publishDate the publishDate to set
	 */
	public void setPublishDate(Date publishDate) {
		this.publishDate = publishDate;
	}

	public String getRemindTarget() {
		return remindTarget;
	}

	public void setRemindTarget(String remindTarget) {
		this.remindTarget = remindTarget;
	}

	public String getNoLimit() {
		return noLimit;
	}

	public void setNoLimit(String noLimit) {
		this.noLimit = noLimit;
	}

	public String getAnswerNum() {
		return answerNum;
	}

	public void setAnswerNum(String answerNum) {
		this.answerNum = answerNum;
	}

	public String getPassScore() {
		return passScore;
	}

	public void setPassScore(String passScore) {
		this.passScore = passScore;
	}
	
}
